﻿using J.ProductGet.Application.Command.ProductSetupCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace J.ProductGet.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProductSetupController : ControllerBase
    {
        private readonly IMediator _mediator;
        public ProductSetupController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 商品管理表添加和修改(传id为修改，负责为添加)
        /// </summary>
        /// <param name="modes"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> ProductSetupGet(ProductSetupGetCommand command)
        {
            return Ok(await _mediator.Send(command));
        }
    }
}
